package com.zjh.document.entity.onlyoffice;


import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class CallBackResponse {
    private String key;
    private int status;
    private String url;
    @JsonProperty("changesurl")
    private String changesUrl;
    private History history;
    private List<String> users;
    private List<Map<String, Object>> actions;
    @JsonProperty("lastsave")
    private Date lastSave;
    @JsonProperty("forcesavetype")
    private int forceSaveType;
    private String token;
    private String filetype;

    // History 内部类
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Accessors(chain = true)
    public static class History {
        private String serverVersion;
        private List<Change> changes;

        // Change 内部类
        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Accessors(chain = true)
        public static class Change {
            private Date created;
            private User user;

            // User 内部类
            @Data
            @AllArgsConstructor
            @NoArgsConstructor
            @Accessors(chain = true)
            public static class User {
                private String id;
                private String name;
            }
        }
    }
}

